<?php

namespace app\models;

use yii\db\ActiveRecord;
use yii\helpers\ArrayHelper;

class OrderExternalAttr extends ActiveRecord
{

    public $attrSpecTypeID;

    public function getAttrSpecTypeID()
    {
        return $this->attrSpecTypeID;

    }

    public function getImages()
    {
        return $this->hasOne(Image::className(), ['id' => 'content']);

    }
    public function getAttrSpecs()
    {
        return $this->hasOne(AttrSpec::className(), ['attr_spec_id' => 'attr_spec_id']);

    }


    //public $attrSpec;
   /* public function rules()
    {
        return [
            ['prod_name', 'required', 'message' => '请填写名称.'],
            ['region_id', 'integer'],
            ['prod_spec_id', 'integer'],

        ];

    }*/

//    public function getCityList($parent_region_id=null)
//    {
//        $model = Region::find()->where(['parent_region_id' => $parent_region_id ])->orderBy('id')->all();
//
//
//        return ArrayHelper::map($model, 'id', 'region_name');
//
//    }
//
//    public function getAttrSpecs()
//    {
//
//        return $this->attrSpec;
//    }
}

?>
